/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package autodiaryserver;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 *
 * @author thang
 */
public class Declare {
    
    // connection
    public static Connection jdbcCon = null;
    //public static Statement stm = null;
    
    // database
    // primary tables
    public static final String GPS_DATA_BUFFER_TABLE_NAME = "d_buf_gpsData";
    public static final String PRIMITIVE_ACTIVITY_BUFFER_TABLE_NAME = "d_buf_primActivities";
    
    // secondary tables
    public static final String ADDRESS_BUFFER_TABLE_NAME = "d_buf_address";
    public static final String PLACES_BUFFER_TABLE_NAME = "d_buf_places";
    public static final String PLACES_TYPES_BUFFER_TABLE_NAME = "d_buf_placesTypes";
    public static final String ACT_GPS_PLACE_BUFFER_TABLE_NAME = "d_buf_actGpsPlace";
    
    public static final String REG_NAME_BUFFER_STARTED = "bufferStarted";
    public static final String REG_VALUE_BUFFER_STARTED_TRUE = "true";
    public static final String REG_VALUE_BUFFER_STARTED_FALSE = "false";
    
    // Test device id
    public static String DEVICE_ID = "samGIIFei";
    
    // situation relations - should be store and query from db later
    public static final String ACT_REL_ELIMINATION = "eliminated";
    
    // situation relations
    public static final ArrayList< ArrayList<String> > eliminatedGroups = new ArrayList< ArrayList<String> >();

    public static void getRelationDB(){
        // only initial once at the moment
        if ( eliminatedGroups.isEmpty() ) {
        
            ArrayList<String> rel = new ArrayList<String>();

            rel.add("walking");
            rel.add("running");
            rel.add("driving");
            rel.add("stayingStill");
            eliminatedGroups.add(rel);

            rel = new ArrayList<String>();
            rel.add("underCover");
            rel.add("outdoor");
            eliminatedGroups.add(rel);
        }
    }

    // for window reasoning with weak constraint
    public static final int     WINDOW_SIZE = 5;     
    public static final int     WINDOW_SLIDES  = 2;
    
    
}
